<?= $this->Html->script('multi-inputs') ?>
<?= $this->Form->create('Price', array(
    'url'      => "/admin_cene/save/{$groupId}",
    'onsubmit' => "savePrices(this); return false"
)) ?>
    <div class="multi-input">
        <? if (empty($prices)) $prices = array(array()) ?>
        
        <? foreach ($prices as $k=>$price): ?>
        <p class="item">
            <?= $this->Form->hidden("{$k}.Price.id", array('value'=>@$price['Price']['id'])) ?>
            <?= $this->Form->hidden("{$k}.Price.price_group_id", array('value'=>$groupId)) ?>
            <?= $this->Form->text("{$k}.Price.label", array(
                'value'       => @$price['Price']['label'],
                'class'       => 'large',
                'required'    => false,
                'placeholder' => 'Naziv...'
            )) ?>
            <?= $this->Form->text("{$k}.Price.value", array(
                'value'       => @$price['Price']['value'],
                'placeholder' => 'Iznos...'
            )) ?>
            <?= $this->Form->select("{$k}.Price.unit", $units, array(
                'value'       => @$price['Price']['unit'],
                'empty'       => false
            )) ?>
        </p>
        <? endforeach ?>
    </div>
    
    <?= $this->Form->submit('Sačuvaj') ?>
<?= $this->Form->end() ?>
